﻿#ifndef FILEUTILS_H
#define FILEUTILS_H
#include <QString>
#include <QDateTime>
#include <QDir>

class FileUtils
{
public:
    FileUtils();

    static QString CreateDirFromDatetime(QString baseFloder,QDateTime dt);

    static bool CreateDir(QString folder);

    static bool ExportToCsv(QMap<QString,QList<double>> data,QString fileName);

    static bool ExportToCsv(QList<QList<QString>> data,QString fileName);

    static QList<QList<QString> > ReadCsvFile(const QString &filePath);

    static QList<QList<QString> > TransposeMatrix(const QList<QList<QString> > &mat);

    static QList<QString> listFilesRecursively(const QDir &dir);

    static QList<QString> listFilesRecursively(const QDir &dir,QString filter);
    static QList<QString> Filter(QList<QString> fileNames, QString filter);
private:
    static void processDirectoryRecursively(QDir dir, const QString &filter, QList<QString> &fileList);
};

#endif // FILEUTILS_H
